# Makefile
# bushaofeng. 2011.8.27
# ver=1.0.0

PUB_M = conn basic bs command ./
PUB_PATH = ./../
INC_PATH = $(addprefix $(PUB_PATH), $(PUB_M))
INCLUDE = $(addprefix -I, $(INC_PATH))

CC              =       g++
#CC             =       gcc -mcpu=v9 -m64
FPIC            =       -fPIC
WARN_LEVL       =       -Wall
FDEBUG          =       -g

EXTRA_OPT       =       $(FDEBUG)
EXTRA_OPT       +=      $(WARN_LEVL)
EXTRA_OPT       +=      $(FPIC)
#EXTRA_OPT       +=      $(DEFS)

LIB_M = m pthread mongoclient boost_thread-mt boost_filesystem boost_program_options boost_system
LIB = $(addprefix -l, $(LIB_M))

TARGET	= libapi.a

all:
	${CC} ${EXTRA_OPT} ${INCLUDE} ${LIB} -c *.cpp
	ar rv ${TARGET} *.o
	cp $(TARGET) ../lib64
	cd test;make

clean:
	rm -f core $(TARGET) *.o
